function sendPlanToolBar(){
	var datas = $("#zySendInspectionPlanList").datagrid("getSelections");
	if(datas.length == 0){
		tip("请选择要分派的巡检计划!");
		return;
	}
	var planIdArr = new Array();
	$.each(datas,function(i,item){
		planIdArr.push(item.id);
	});
	sendPlan(planIdArr);
}
function sendPlanCol(id){
	sendPlan(new Array([id]));
}
function sendPlan(planIdArr){
	var planIds = planIdArr.join(",");
	//检查巡检计划状态是否可以继续分派
	$("#zySendInspectionPlanListtb").parent().append('<div class="datagrid-mask" style="display:block"></div><div class="datagrid-mask-msg" style="display: block; left: 50%; margin-left: -58px;">验证中...</div>');
	$.ajax({
		url : "zyInspectionPlanController.do?checkPlanState",
		data : {
			"planIds" : planIds
			},
		cache : false,
		dataType : 'json',
		type : 'POST',
		success : function(data){
			$("#zySendInspectionPlanListtb").parent().find(".datagrid-mask").remove();
			$("#zySendInspectionPlanListtb").parent().find(".datagrid-mask-msg").remove();
			if(data.success){
				if(planIdArr.length == 1){
					createwindow("分派巡检计划","zyInspectionPlanController.do?goBatchSendPlan&ipCount="+planIdArr.length + "&planId="+planIdArr[0],470,200);
				}else{
					createwindow("分派巡检计划","zyInspectionPlanController.do?goBatchSendPlan&ipCount="+planIdArr.length ,470,200);
				}
//				createwindow("分派巡检计划","zyInspectionPlanController.do?goBatchSendPlan&planIds="+planIds+"&ipCount="+planIdArr.length ,470,200);
			}else{
				tip(data.msg);
			}
		}
	});
}
function planDetials(filedName,url){
	addOneTab("巡检计划详情",url);	
}
function exportIp(){
	var currPageRows = $("#zySendInspectionPlanList").datagrid("getRows");
	var idsData = [];
	$(currPageRows).each(function(i,rowData){
		idsData.push(rowData.id);
	});
	if(idsData.length > 0){
		myDownload("zyInspectionPlanController.do?exportInspectionPlan","planIds="+idsData.join(","));
	}else{
		tip("当前页面没有数据可以导出");
	}
}